<table class="table table-border table-bordered table-hover table-bg">
	<thead>
		<tr class="text-c">
			<th width="25"><input type="checkbox" value="" name=""></th>
			<th>物品编号</th>
			<th>物品名称</th>
			<th>成本单价</th>
			<th>出租单价</th>
			<th>减配单价</th>
			<th>出租数量</th>
			<th>单位</th>
			<th>录入员</th>
			<th>状态</th>
			<th>录入时间</th>
			<th width="50">操作</th>
		</tr>
	</thead>
	<tbody>
		<?php if(is_array($accesslist) && count($accesslist)){ ?>
		<?php foreach($accesslist as $k=>$user){ ?>
		<tr class="text-c">
			<td><input type="checkbox" value="{$user['access_id']}" name=""></td>
			<td>{$user['access_no']}</td>
			<td>{$user['title']}</td>
			<td>{$user['costprice']}</td>
			<td>{$user['price']}</td>
			<td>{$user['subprice']}</td>
			<td>{$user['count']}</td>
			<td>{$user['unit']}</td>
			<td>{$user['admin_nick']}</td>
			<td>
				<span class="select-box radius" style="width: 80px">
				  	<select class="select mstatus" size="1" user_id="{$user['access_id']}">
					  	<option value="1" <?php echo $user['visible'] == 1 ? 'selected' : ''; ?>>正常</option>
					  	<option value="0" <?php echo $user['visible'] == 0 ? 'selected' : ''; ?>>禁用</option>
				  	</select>
				</span>	
			</td>
			<td>{$user['createtime']|date="Y-m-d H:i", ###}</td>
			<td>
				<a href="javascript:void(0);" title="编辑" onclick="admin_role_edit('物品录入','add.html?aid={$user['access_id']}', 1,'920', '450');" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
			</td>
		</tr>
		<?php } }else{ ?>
		<tr class="text-c">
			<td colspan="19" >暂无数据...</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<!--page-->
<include file="Common/page" />
<script>
	$(document).ready(function(){
		$(".mstatus").on('change', function(){
			var obj = $(this);
			var	user_id = obj.attr('user_id');
			var	status = $(this).val();
			
			var load = layer.load(2);
			$.post("setStatus.html",{userid: user_id, visible: status}, function(data){
				layer.close(load);
				if(data/1 == 1){
					layer.msg('设置成功', {icon:1, time: 2000});
				}else{
					layer.msg('设置失败', {icon:2, time: 2000});
				}
			});
		});
	});
</script>